package com.thread.threadfirst.marvel.citymaster.enums;
import lombok.Getter;


/**
 *  ApplyCityType  1 城主  2  副城主1 3 副城主2
 */
@Getter
public enum ApplyCityType {

    CT1(1, "城主"),
    CT2(2, "副城主2"),
    CT3(3, "副城主3");

    private final String description;
    private final Integer value;

    ApplyCityType(int value, String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 根据key获取枚举
     *
     * @param key
     * @return
     */
    public static ApplyCityType getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (ApplyCityType temp : ApplyCityType.values()) {
            if (temp.value.equals(key)) {
                return temp;
            }
        }
        return null;
    }

}
